func jump(nums []int) int {
	n := len(nums)
	dp := make([]int, n+1)
	dp[0] = 0
	for i := 1; i < n; i++ {
		m := math.MaxInt32
		for j := 0; j < i; j++ {
			if j+nums[j] >= i {
				m = min(m, dp[j]+1)
			}
		}
		dp[i] = m
	}
	return dp[n-1]
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
